﻿@using MvcForum.Web.Application.ExtensionMethods
@model MvcForum.Web.ViewModels.Admin.SocialSettingsViewModel
@{
    ViewBag.Title = "Social Settings";
}

<div class="panel">
    <div class="panel-heading">
        <h4 class="panel-title">
            @ViewBag.Title
        </h4>
    </div>
    <div class="panel-body">
        <p>Enable Social logins using the checkbox below, we use <a href="https://github.com/abjerner/Skybrud.Social" target="_blank">SkyBrud.Social</a> as the library for Social logins.</p>

        @using (Html.BeginForm("Index", "AdminSocial", FormMethod.Post))
        {
            @Html.ValidationSummary(false)

            <div class="checkbox">
                @using (Html.BeginLabelFor(m => m.EnableSocialLogins, new { @class = "checkbox" }))
                {
                    @Html.CheckBoxFor(m => m.EnableSocialLogins)
                }
                @Html.ValidationMessageFor(m => m.EnableSocialLogins)
            </div>

            <div class="submit-holder">
                <input type="submit" class="btn-mvc-green btn-mvc-large" value="Update" />
            </div>
        }

        <hr />
        @if (string.IsNullOrEmpty(Model.FacebookAppId))
        {
            <p><span class="label label-warning">Note</span> Facebook login will not work until the Facebook App Id and Secret Key are added to the web.config (appSettings)</p>
            <p>Ref: <a href="https://developers.facebook.com/">https://developers.facebook.com/</a></p>
        }
        else
        {
            <p>Facebook App Id: @Model.FacebookAppId</p>
            <p>Facebook Secret: @Model.FacebookAppSecret</p>
        }

        @if (string.IsNullOrEmpty(Model.GooglePlusAppId))
        {
            <p><span class="label label-warning">Note</span> Google login will not work until the Google App Id and Secret Key are added to the web.config (appSettings)</p>
            <p>Ref: <a href="https://console.developers.google.com/project">https://console.developers.google.com/project</a></p>
        }
        else
        {
            <p>Google App Id: @Model.GooglePlusAppId</p>
            <p>Google Secret: @Model.GooglePlusAppSecret</p>
        }
        
        @if (string.IsNullOrEmpty(Model.MicrosoftAppId))
        {
            <p><span class="label label-warning">Note</span> Microsoft login will not work until the Google App Id and Secret Key are added to the web.config (appSettings)</p>
            <p>Ref: <a href="https://account.live.com/developers/applications/create">https://account.live.com/developers/applications/create</a></p>
        }
        else
        {
            <p>Microsoft App Id: @Model.MicrosoftAppId</p>
            <p>Microsoft Secret: @Model.MicrosoftAppSecret</p>
        }

    </div>
</div>